package com.example.cart.properties;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.validation.annotation.Validated;

import javax.validation.constraints.NotNull;

@ConfigurationProperties(prefix = "shopping.cart")
@Validated
@Data
public class ShoppingCartProperties {

    /**
     * 购物车的最大容量
     */
    @NotNull
    private Integer maxCapacity;

    /**
     * 是否启用自动清理过期商品，默认为 true。
     */
    private boolean autoCleanupEnabled = true;

}
